#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   slider.py
@Time    :   2024/01/23 23:35:56
@Author  :   chakcy 
@Email   :   947105045@qq.com
@description   :   滑块
'''

from selenium.webdriver import Chrome
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains

# 滑动滑块
def sliding(driver:Chrome, slider_selector:str, slider_button_selector:str):
    ele = driver.find_element(By.CSS_SELECTOR, slider_selector)
    ele_button = driver.find_element(By.CSS_SELECTOR, slider_button_selector)
    chains = ActionChains(driver)
    chains.drag_and_drop_by_offset(ele_button, ele.size['width'] - ele_button.size['width'], 0)
    chains.perform()
    